//
//  HZWModel.m
//  开心一刻
//
//  Created by lanou on 16/4/12.
//  Copyright © 2016年 刘洋. All rights reserved.
//

#import "HZWModel.h"

@implementation HZWModel
-(void)setValue:(id)value forUndefinedKey:(NSString *)key{
    
}
+(NSMutableArray *)requestModel:(NSDictionary *)dic
{
   
    NSMutableArray * modelArray =[NSMutableArray array];
    NSMutableArray * keyArray =[NSMutableArray array];
    NSMutableArray * allARRAY = [NSMutableArray array];
   
    NSArray * issueLisArray = dic[@"issueList"];
    for (NSDictionary * DIC in issueLisArray )
    {
        HZWModel * model = [[HZWModel alloc]init];
        NSArray * array = DIC[@"itemList"];
        NSDictionary * dicx = array[0];
        NSDictionary * dicxx = dicx[@"data"];
        model.text = dicxx[@"text"];
        model.image = dicxx[@"image"];
        [keyArray  addObject:model];
        NSMutableArray * oneArray = [NSMutableArray array];
        if (model.text == nil && model.image == nil)
        {
            for (NSDictionary * sss in array)
            {
                HZWModel * model = [[HZWModel alloc]init];
                NSDictionary * one = sss[@"data"];
                [model setValuesForKeysWithDictionary:one];
                NSDictionary * ttt = one[@"cover"];
                [model setValuesForKeysWithDictionary:ttt];
               //   NSLog(@"=================%@",model.detail);
                [oneArray addObject:model];
               
                
            }
        }
        else
        {
            for (int i = 1 ; i < array.count; i++)
            {
                 HZWModel * model = [[HZWModel alloc]init];
                NSDictionary * two = array[i];
                 NSDictionary * one1 = two[@"data"];
                model.descriptionx = one1[@"description"];
                 [model setValuesForKeysWithDictionary:one1];
                    NSDictionary * ttt = one1[@"cover"];
               [model setValuesForKeysWithDictionary:ttt];
               // NSLog(@"=================%@",model.detail);
                [oneArray addObject:model];
             
            }
            
        }
        [allARRAY addObject:oneArray];
    }
    
    [modelArray addObject:keyArray];
    [modelArray addObject:allARRAY];
    

    return modelArray;
}

@end
